package com.iotechn.unimall.admin.api.feie;

import com.iotechn.unimall.biz.service.order.OrderBizService;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.util.FeiEPrintUtil;
import com.iotechn.unimall.data.dto.order.OrderDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FeiEServiceImpl implements FeiEService {

    @Autowired
    private OrderBizService orderBizService;

    @Override
    public String printOrder(Long orderId) throws ServiceException {
        OrderDTO orderDTO = orderBizService.getOrderDetail(orderId, null);
        return FeiEPrintUtil.print(FeiEPrintUtil.SN,FeiEPrintUtil.getOrderByOrderDTO(orderDTO));
    }
}